package com.active.api;

import com.active.bean.ActiveInfo;
import com.active.bean.ActiveList;
import com.active.bean.ActiveWisdom;

import java.util.List;

public interface ActiveHandle {

    /**
     * 初始化和刷新
     * @param currentPage
     * @return
     * @throws Exception
     */
    List<ActiveList> refreshListView(int currentPage,int userId) throws Exception;

    ActiveList getActiveListById(Integer id,int userId) throws Exception;

    /**
     * 获取任务节点
     * 按照任务节点顺序排列
     * @param activeListId
     * @return
     */
    List<ActiveInfo> getActiveNodes(Integer activeListId,int userId) throws Exception;

    /**
     * 启动任务
     * @param activeListId
     * @throws Exception
     */
    void startMission(Integer activeListId,int userId) throws Exception;

    /**
     * 停止任务
     * @param activeListId
     * @throws Exception
     */
    void stopMission(Integer activeListId,int userId) throws Exception;


    /**
     * 下一个任务
     * @param activeListId
     * @throws Exception
     */
    void nextMission(Integer activeListId, Integer state,int userId) throws Exception;


    /**
     * 上一个任务
     * @param activeListId
     * @throws Exception
     */
    void prevMission(Integer activeListId,int userId) throws Exception;


    /**
     * 添加新的任务
     * @param mission
     * @param missionNodes
     * @return
     */
    int addMission(ActiveList mission, List<ActiveInfo> missionNodes,int userId) throws Exception;

    /**
     * 删除一个任务
     * @param activeListId
     * @return
     */
    int deleteMission(Integer activeListId,int userId) throws Exception;

    List<ActiveWisdom> randomActiveWisdom(Integer num) throws Exception;
}
